Skip to content

[Feat] 기획 변경에 따른 온보딩 API 수정#196

Merged
eraser502 merged 6 commits intodevelopfrom
feat/#186-onboarding
Mar 21, 2026
Merged

[Feat] 기획 변경에 따른 온보딩 API 수정#196
eraser502 merged 6 commits intodevelopfrom
feat/#186-onboarding

Conversation

@eraser502
Copy link
Copy Markdown
Collaborator

@eraser502 eraser502 commented Mar 19, 2026

Related issue 🛠

Work Description 📝

  • 온보딩 API V2를 구현했어요
    • 기존 온보딩 API를 바로 변경하게되면 클라이언트에서 변경할때까지 오류가 발생하기 때문에 V2로 분리하였어요.
    • 또한 Member 엔티티에 관심 산업 필드, 준비 상태 필드를 추가 했어요.
  • 온보딩에 필요한 산업 필드, 대학 리스트 조회 API를 구현했어요.

ScreenShots 📷

To Reviewers 📢

Summary by CodeRabbit

  • 새로운 기능

    • 온보딩에서 대학 목록 및 관심 분야 목록 조회 기능 추가
    • 비자 정보 및 추가 프로필(학력, 영어 수준 등)을 지원하는 향상된 온보딩(v2) 엔드포인트 추가
    • 사용자 관심 분야 및 준비 상태를 저장하는 기능 추가
  • 관리/운영

    • v2 온보딩 엔드포인트에 대한 예외 필터(허용 목록) 확장 및 API 경로 등록 반영

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 26344538-4e09-4236-80af-97faa5b85c99

📥 Commits

Reviewing files that changed from the base of the PR and between cccad4b and 1d5b1ce.

📒 Files selected for processing (3)
  • src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java
  • src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java
  • src/main/java/org/sopt/kareer/global/security/filter/OnboardingRestrictionFilter.java
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/org/sopt/kareer/global/security/filter/OnboardingRestrictionFilter.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java
  • src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java

📝 Walkthrough

Walkthrough

온보딩 V2를 도입하며 대학/분야 조회 엔드포인트와 V2 온보딩 POST를 추가하고, 온보딩 DTO/응답, 상수(대학/분야), Member 엔티티 필드 및 서비스 onboarding 로직(비자 처리 포함)을 확장합니다.

Changes

Cohort / File(s) Summary
컨트롤러 — 엔드포인트 추가
src/main/java/org/sopt/kareer/domain/member/controller/MemberController.java, src/main/java/org/sopt/kareer/domain/member/controller/MemberControllerV2.java
GET /onboard/universities, GET /onboard/fields 추가 및 /api/v2/members/onboard POST 엔드포인트(온보딩 V2) 추가.
온보딩 DTOs (요청/응답)
src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java, src/main/java/org/sopt/kareer/domain/member/dto/response/OnboardFieldsResponse.java, src/main/java/org/sopt/kareer/domain/member/dto/response/OnboardUniversitiesResponse.java
V2 요청 레코드 추가(비자 관련 검증 포함) 및 대학/분야 응답 레코드와 팩토리 메서드 추가.
상수 목록
src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java, src/main/java/org/sopt/kareer/domain/member/entity/constants/Field.java
대학 목록(UNIVERSITY_LIST)과 분야 목록(FIELD_LIST)을 불변 상수로 추가.
도메인 엔티티 변경
src/main/java/org/sopt/kareer/domain/member/entity/Member.java
Member에 preparationStatus, fieldsOfInterest 필드 추가 및 updateInfo() 시그니처 확장(온보딩 관련 추가 파라미터).
서비스 로직
src/main/java/org/sopt/kareer/domain/member/service/MemberService.java
기존 onboardMember() 조정(추가 필드 매핑/널 설정) 및 onboardMemberV2() 신규 메서드 추가: 관심분야/준비상태 문자열 빌드, Member 업데이트, MemberVisa 생성/저장.
보안 필터
src/main/java/org/sopt/kareer/global/security/filter/OnboardingRestrictionFilter.java
온보딩 허용 목록에 V2 경로 "/api/v2/members/onboard/**" 추가.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant Ctrl as MemberControllerV2
    participant Svc as MemberService
    participant Mem as Member
    participant Visa as MemberVisa
    participant DB as Database

    Client->>Ctrl: POST /api/v2/members/onboard (memberId, MemberOnboardV2Request)
    Ctrl->>Svc: onboardMemberV2(request, memberId)
    Svc->>DB: find member by id
    DB-->>Svc: Member entity
    Svc->>Mem: updateInfo(..., university, englishLevel, fieldsOfInterests, preparationStatuses, ...)
    Mem->>DB: persist Member
    Svc->>Visa: create MemberVisa(visaType, start, expired, visaPoint)
    Visa->>DB: save MemberVisa
    Svc-->>Ctrl: 성공
    Ctrl-->>Client: 200 OK (BaseResponse<Void>)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • hyomee2
  • jeong1112

Poem

🐰 새 길을 깐 당근 한 조각,
대학과 분야를 줄줄 외우네,
비자 점수도 살며시 챙기고,
V2로 훨훨, 온보딩 끝! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 온보딩 API 수정이라는 주요 변경사항을 명확히 설명하며, 변경 범위와 의도를 잘 요약하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 주요 코드 변경(V2 API 구현, Member 엔티티 필드 추가, 조회 API 구현, 필터 업데이트)이 issue #186의 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 온보딩 API 수정이라는 명확한 범위 내에 있으며, 무관한 변경이나 범위를 벗어난 수정은 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#186-onboarding
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/org/sopt/kareer/domain/member/entity/Member.java (1)

85-111: ⚠️ Potential issue | 🔴 Critical

V2 온보딩에서 받은 신규 값들이 전부 유실됩니다.

src/main/java/org/sopt/kareer/domain/member/service/MemberService.java:98-105는 대학, 영어 레벨, 관심 분야, 준비 상태를 여기로 넘기고 있지만, 이 메서드는 그 값을 엔티티 필드에 한 번도 대입하지 않습니다. 지금 상태로는 온보딩 성공 응답 이후에도 네 값이 저장되지 않습니다.

예시 수정
     public void updateInfo(String name,
                            LocalDate birthDate,
                            Country country,
                            String university,
                            EnglishLevel englishLevel,
                            String fieldsOfInterests,
                            String preparationStatuses,
                            LanguageLevel languageLevel,
                            Degree degree,
                            LocalDate expectedGraduationDate,
                            String primaryMajor,
                            String secondaryMajor,
                            String targetJob,
                            String targetJobSkill) {
         assertPendingStatus();
         this.name = name;
         this.birthDate = birthDate;
         this.country = country;
+        this.university = university;
+        this.englishLevel = englishLevel;
+        this.fieldsOfInterest = fieldsOfInterests;
+        this.preparationStatus = preparationStatuses;
         this.languageLevel = languageLevel;
         this.degree = degree;
         this.expectedGraduationDate = expectedGraduationDate;
         this.primaryMajor = primaryMajor;
         this.secondaryMajor = secondaryMajor;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/org/sopt/kareer/domain/member/entity/Member.java` around lines
85 - 111, The updateInfo method in Member (updateInfo) never assigns the
incoming university, englishLevel, fieldsOfInterests, and preparationStatuses
parameters to the entity, so values passed from MemberService are lost; update
the method to set this.university = university, this.englishLevel =
englishLevel, this.fieldsOfInterests = fieldsOfInterests, and
this.preparationStatuses = preparationStatuses (keeping the existing assignments
for other fields and status and preserving assertPendingStatus() behavior).
🧹 Nitpick comments (2)
src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java (2)

34-35: expectedGraduationDate에 대한 cross-field 검증 누락.

visaPointisVisaPointValid() 메서드로 D10 비자일 때만 필수/허용되도록 검증하고 있습니다. 그러나 expectedGraduationDate는 Schema 설명에 "D2 비자인 경우만"이라고 명시되어 있음에도 불구하고 동일한 cross-field 검증이 없습니다. D2가 아닌 경우에도 값이 입력될 수 있고, D2인 경우 필수 여부도 검증되지 않습니다.

비즈니스 요구사항에 따라 isExpectedGraduationDateValid() 메서드를 추가하는 것을 고려해 주세요.

♻️ 예시 구현
`@AssertTrue`(message = "예상 졸업일은 D2 비자인 경우에만 입력할 수 있습니다.")
`@Schema`(hidden = true)
public boolean isExpectedGraduationDateValid() {
    if (visaType == null) {
        return expectedGraduationDate == null;
    }
    if (visaType == VisaType.D2) {
        return expectedGraduationDate != null;
    }
    return expectedGraduationDate == null;
}

Also applies to: 65-75

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java`
around lines 34 - 35, MemberOnboardV2Request is missing cross-field validation
for expectedGraduationDate (field expectedGraduationDate) against visaType; add
a boolean validator method isExpectedGraduationDateValid() (annotated with
`@AssertTrue` and `@Schema`(hidden = true)) that enforces: when visaType == null
then expectedGraduationDate must be null, when visaType == VisaType.D2 then
expectedGraduationDate must be non-null, and for any other visaType
expectedGraduationDate must be null; place this method in the
MemberOnboardV2Request class alongside isVisaPointValid() to satisfy the Schema
requirement "D2 비자인 경우만."

16-17: university 필드에 @NotNull 대신 @NotBlank 사용 권장.

다른 String 필드들(name, primaryMajor, targetJob)은 @NotBlank를 사용하여 빈 문자열을 방지하고 있습니다. university도 String 타입이므로 일관성과 빈 문자열 방지를 위해 @NotBlank를 사용하는 것이 적절합니다.

♻️ 수정 제안
-        `@NotNull`(message = "대학교는 필수 입력값입니다.")
+        `@NotBlank`(message = "대학교는 필수 입력값입니다.")
         String university,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java`
around lines 16 - 17, Replace the `@NotNull` on the university field in
MemberOnboardV2Request with `@NotBlank` to prevent empty strings and keep
validation consistent with other String fields (name, primaryMajor, targetJob);
update the import to javax.validation.constraints.NotBlank if needed and ensure
the validation message remains appropriate for the university field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/org/sopt/kareer/domain/member/controller/MemberControllerV2.java`:
- Around line 18-29: The OnboardingRestrictionFilter currently allows only the
v1 onboarding path, preventing PENDING users from reaching
MemberControllerV2.onboardMember; update the filter (class
OnboardingRestrictionFilter) to include the v2 onboarding pattern (e.g.
"/api/v2/members/onboard" or "/api/v2/members/onboard/**") in the allowed/exempt
paths collection or matcher list so that requests to MemberControllerV2's POST
/onboard are bypassed by the onboarding restriction check.

In
`@src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java`:
- Around line 51-52: The fieldsOfInterests declaration in MemberOnboardV2Request
currently uses only `@NotNull` so an empty list or >5 entries still pass
validation despite the message; add a collection size constraint (e.g.,
`@Size`(min = 1, max = 5)) to the fieldsOfInterests field so the validation
enforces "최소 1개, 최대 5개" alongside `@NotNull`, importing the appropriate
javax.validation.constraints.Size if needed.

In
`@src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java`:
- Line 111: The University enum contains malformed/concatenated names (e.g.,
"Chongjunationaluniversityofeducation", "Busandigital University",
"Daejeoncatholic University") that will surface directly to users; open the
University enum and replace those constants with their correctly spaced/cased
names ("Chongju National University of Education", "Busan Digital University",
"Daejeon Catholic University") and then add a simple normalization/validation
unit test (or a static initializer in University) to assert every entry contains
at least one space and uses proper word boundaries so future malformed inputs
fail CI.

---

Outside diff comments:
In `@src/main/java/org/sopt/kareer/domain/member/entity/Member.java`:
- Around line 85-111: The updateInfo method in Member (updateInfo) never assigns
the incoming university, englishLevel, fieldsOfInterests, and
preparationStatuses parameters to the entity, so values passed from
MemberService are lost; update the method to set this.university = university,
this.englishLevel = englishLevel, this.fieldsOfInterests = fieldsOfInterests,
and this.preparationStatuses = preparationStatuses (keeping the existing
assignments for other fields and status and preserving assertPendingStatus()
behavior).

---

Nitpick comments:
In
`@src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java`:
- Around line 34-35: MemberOnboardV2Request is missing cross-field validation
for expectedGraduationDate (field expectedGraduationDate) against visaType; add
a boolean validator method isExpectedGraduationDateValid() (annotated with
`@AssertTrue` and `@Schema`(hidden = true)) that enforces: when visaType == null
then expectedGraduationDate must be null, when visaType == VisaType.D2 then
expectedGraduationDate must be non-null, and for any other visaType
expectedGraduationDate must be null; place this method in the
MemberOnboardV2Request class alongside isVisaPointValid() to satisfy the Schema
requirement "D2 비자인 경우만."
- Around line 16-17: Replace the `@NotNull` on the university field in
MemberOnboardV2Request with `@NotBlank` to prevent empty strings and keep
validation consistent with other String fields (name, primaryMajor, targetJob);
update the import to javax.validation.constraints.NotBlank if needed and ensure
the validation message remains appropriate for the university field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d2ccc091-8337-486f-9e4c-136f54519608

📥 Commits

Reviewing files that changed from the base of the PR and between c9acb2b and cccad4b.

📒 Files selected for processing (9)
  • src/main/java/org/sopt/kareer/domain/member/controller/MemberController.java
  • src/main/java/org/sopt/kareer/domain/member/controller/MemberControllerV2.java
  • src/main/java/org/sopt/kareer/domain/member/dto/request/MemberOnboardV2Request.java
  • src/main/java/org/sopt/kareer/domain/member/dto/response/OnboardFieldsResponse.java
  • src/main/java/org/sopt/kareer/domain/member/dto/response/OnboardUniversitiesResponse.java
  • src/main/java/org/sopt/kareer/domain/member/entity/Member.java
  • src/main/java/org/sopt/kareer/domain/member/entity/constants/Field.java
  • src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java
  • src/main/java/org/sopt/kareer/domain/member/service/MemberService.java

Comment thread src/main/java/org/sopt/kareer/domain/member/entity/constants/University.java Outdated
Copy link
Copy Markdown
Collaborator

@hyomee2 hyomee2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿 고생하셨습니다~~

@eraser502 eraser502 merged commit d911ef2 into develop Mar 21, 2026
2 checks passed
@eraser502 eraser502 deleted the feat/#186-onboarding branch March 21, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 기획 변경에 따른 온보딩 API 수정

2 participants